.class public Lcom/instagram/android/activity/k;
.super Ljava/lang/Object;
.source "CaptureFlowHelper.java"


# instance fields
.field public a:Ljava/io/File;

.field private b:Landroid/content/Context;

.field private c:Lcom/instagram/android/activity/m;

.field private d:I

.field private e:Z


# direct methods
.method public constructor <init>(Landroid/app/Activity;)V
    .locals 1
    .parameter

    .prologue
    .line 53
    move-object v0, p1

    check-cast v0, Lcom/instagram/android/activity/m;

    invoke-direct {p0, p1, v0}, Lcom/instagram/android/activity/k;-><init>(Landroid/content/Context;Lcom/instagram/android/activity/m;)V

    .line 54
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lcom/instagram/android/activity/m;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 56
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 57
    iput-object p1, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    .line 58
    iput-object p2, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    .line 59
    return-void
.end method

.method static synthetic a(Lcom/instagram/android/activity/k;)Lcom/instagram/android/activity/m;
    .locals 1
    .parameter

    .prologue
    .line 34
    iget-object v0, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    return-object v0
.end method

.method private a()V
    .locals 4

    .prologue
    .line 89
    const/4 v0, 0x2

    new-array v0, v0, [Ljava/lang/CharSequence;

    const/4 v1, 0x0

    iget-object v2, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    sget v3, Lcom/facebook/ba;->legacy_camera_capture_options_item_photo:I

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

    const/4 v1, 0x1

    iget-object v2, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    sget v3, Lcom/facebook/ba;->legacy_camera_capture_options_item_gallery:I

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

    .line 94
    new-instance v1, Lcom/instagram/ui/a/a;

    iget-object v2, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    invoke-direct {v1, v2}, Lcom/instagram/ui/a/a;-><init>(Landroid/content/Context;)V

    sget v2, Lcom/facebook/ba;->legacy_camera_capture_options_title:I

    invoke-virtual {v1, v2}, Lcom/instagram/ui/a/a;->b(I)Lcom/instagram/ui/a/a;

    move-result-object v1

    new-instance v2, Lcom/instagram/android/activity/l;

    invoke-direct {v2, p0, v0}, Lcom/instagram/android/activity/l;-><init>(Lcom/instagram/android/activity/k;[Ljava/lang/CharSequence;)V

    invoke-virtual {v1, v0, v2}, Lcom/instagram/ui/a/a;->a([Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Lcom/instagram/ui/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/ui/a/a;->b()Landroid/app/Dialog;

    move-result-object v0

    .line 116
    invoke-virtual {v0}, Landroid/app/Dialog;->show()V

    .line 117
    return-void
.end method

.method private b()V
    .locals 3

    .prologue
    .line 120
    iget-object v0, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    invoke-static {v0}, Lcom/instagram/n/a;->b(Landroid/content/Context;)Ljava/io/File;

    move-result-object v0

    iput-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    .line 121
    iget-object v0, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    iget-object v1, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    const/16 v2, 0x2712

    invoke-interface {v0, v1, v2}, Lcom/instagram/android/activity/m;->b(Ljava/io/File;I)V

    .line 122
    return-void
.end method

.method static synthetic b(Lcom/instagram/android/activity/k;)V
    .locals 0
    .parameter

    .prologue
    .line 34
    invoke-direct {p0}, Lcom/instagram/android/activity/k;->b()V

    return-void
.end method

.method static synthetic c(Lcom/instagram/android/activity/k;)Landroid/content/Context;
    .locals 1
    .parameter

    .prologue
    .line 34
    iget-object v0, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    return-object v0
.end method

.method private c()V
    .locals 4

    .prologue
    .line 174
    iget-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->isFile()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 175
    iget-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-static {v0}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;

    move-result-object v0

    .line 176
    iget-object v1, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-virtual {v1}, Ljava/io/File;->delete()Z

    move-result v1

    if-nez v1, :cond_0

    .line 177
    const-string v1, "CaptureFlowHelper"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Failed to delete "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/facebook/e/a/a;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 180
    :cond_0
    iget-object v1, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, v0, v2}, Landroid/content/ContentResolver;->notifyChange(Landroid/net/Uri;Landroid/database/ContentObserver;)V

    .line 182
    :cond_1
    return-void
.end method


# virtual methods
.method public a(IILandroid/content/Intent;)V
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    const/16 v2, 0x2711

    .line 136
    const/4 v0, -0x1

    if-eq p2, v0, :cond_0

    .line 137
    invoke-direct {p0}, Lcom/instagram/android/activity/k;->c()V

    .line 138
    iget-object v0, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    invoke-interface {v0, p1}, Lcom/instagram/android/activity/m;->a_(I)V

    .line 171
    :goto_0
    return-void

    .line 143
    :cond_0
    packed-switch p1, :pswitch_data_0

    goto :goto_0

    .line 161
    :pswitch_0
    iget v0, p0, Lcom/instagram/android/activity/k;->d:I

    if-eqz v0, :cond_1

    iget v0, p0, Lcom/instagram/android/activity/k;->d:I

    const/4 v1, 0x2

    if-ne v0, v1, :cond_2

    .line 163
    :cond_1
    invoke-direct {p0}, Lcom/instagram/android/activity/k;->c()V

    .line 165
    :cond_2
    iget-object v0, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    invoke-interface {v0}, Lcom/instagram/android/activity/m;->c()V

    goto :goto_0

    .line 145
    :pswitch_1
    iget-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-static {p3, v0}, Lcom/instagram/creation/base/e;->a(Landroid/content/Intent;Ljava/io/File;)Landroid/net/Uri;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1, v2}, Lcom/instagram/android/activity/k;->a(Landroid/net/Uri;II)V

    goto :goto_0

    .line 152
    :pswitch_2
    iget-object v0, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    iget-object v1, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-static {v0, v1}, Lcom/instagram/android/util/i;->a(Landroid/content/ContentResolver;Ljava/io/File;)V

    .line 153
    iget-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-static {p3, v0}, Lcom/instagram/android/util/i;->a(Landroid/content/Intent;Ljava/io/File;)Landroid/net/Uri;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {p0, v0, v1, v2}, Lcom/instagram/android/activity/k;->a(Landroid/net/Uri;II)V

    goto :goto_0

    .line 143
    nop

    :pswitch_data_0
    .packed-switch 0x2711
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_0
    .end packed-switch
.end method

.method public a(Landroid/net/Uri;)V
    .locals 3
    .parameter

    .prologue
    .line 79
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    const-class v2, Lcom/instagram/android/creation/activity/MediaCaptureActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 80
    const-string v1, "videoFilePath"

    invoke-virtual {v0, v1, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 81
    const-string v1, "mediaSource"

    const/4 v2, 0x2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 83
    iget-object v1, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    const/16 v2, 0x2714

    invoke-interface {v1, v0, v2}, Lcom/instagram/android/activity/m;->a_(Landroid/content/Intent;I)V

    .line 86
    return-void
.end method

.method public a(Landroid/net/Uri;II)V
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 125
    iput p2, p0, Lcom/instagram/android/activity/k;->d:I

    .line 126
    iget-object v0, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    invoke-static {v0, p1}, Lcom/instagram/android/support/camera/a;->a(Landroid/content/Context;Landroid/net/Uri;)Lcom/instagram/android/support/camera/a;

    move-result-object v0

    iget v1, p0, Lcom/instagram/android/activity/k;->d:I

    invoke-virtual {v0, v1}, Lcom/instagram/android/support/camera/a;->b(I)Lcom/instagram/android/support/camera/a;

    move-result-object v0

    iget-boolean v1, p0, Lcom/instagram/android/activity/k;->e:Z

    invoke-virtual {v0, v1}, Lcom/instagram/android/support/camera/a;->b(Z)Lcom/instagram/android/support/camera/a;

    move-result-object v0

    .line 130
    iget-object v1, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    invoke-virtual {v0}, Lcom/instagram/android/support/camera/a;->a()Landroid/content/Intent;

    move-result-object v0

    invoke-interface {v1, v0, p3}, Lcom/instagram/android/activity/m;->a_(Landroid/content/Intent;I)V

    .line 133
    return-void
.end method

.method public a(Landroid/os/Bundle;)V
    .locals 2
    .parameter

    .prologue
    .line 185
    iget-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    if-eqz v0, :cond_0

    .line 186
    const-string v0, "tempPhotoFile"

    iget-object v1, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    invoke-virtual {v1}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 188
    :cond_0
    const-string v0, "isDirectShare"

    iget-boolean v1, p0, Lcom/instagram/android/activity/k;->e:Z

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 189
    return-void
.end method

.method public a(Z)V
    .locals 3
    .parameter

    .prologue
    .line 62
    iput-boolean p1, p0, Lcom/instagram/android/activity/k;->e:Z

    .line 63
    invoke-static {}, Lcom/instagram/m/a/b;->a()Lcom/instagram/m/a/b;

    move-result-object v0

    .line 64
    invoke-virtual {v0}, Lcom/instagram/m/a/b;->e()Z

    move-result v0

    .line 66
    iget-object v1, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    invoke-static {v1}, Lcom/instagram/camera/a;->a(Landroid/content/pm/PackageManager;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 67
    invoke-direct {p0}, Lcom/instagram/android/activity/k;->b()V

    .line 76
    :goto_0
    return-void

    .line 68
    :cond_0
    if-eqz v0, :cond_1

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x8

    if-gt v0, v1, :cond_2

    .line 69
    :cond_1
    invoke-direct {p0}, Lcom/instagram/android/activity/k;->a()V

    goto :goto_0

    .line 71
    :cond_2
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/instagram/android/activity/k;->b:Landroid/content/Context;

    const-class v2, Lcom/instagram/android/creation/activity/MediaCaptureActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 72
    const/high16 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 73
    const-string v1, "directShare"

    iget-boolean v2, p0, Lcom/instagram/android/activity/k;->e:Z

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 74
    iget-object v1, p0, Lcom/instagram/android/activity/k;->c:Lcom/instagram/android/activity/m;

    const/16 v2, 0x2711

    invoke-interface {v1, v0, v2}, Lcom/instagram/android/activity/m;->a_(Landroid/content/Intent;I)V

    goto :goto_0
.end method

.method public b(Landroid/os/Bundle;)V
    .locals 2
    .parameter

    .prologue
    .line 192
    if-eqz p1, :cond_1

    .line 193
    const-string v0, "tempPhotoFile"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 194
    new-instance v0, Ljava/io/File;

    const-string v1, "tempPhotoFile"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/instagram/android/activity/k;->a:Ljava/io/File;

    .line 196
    :cond_0
    const-string v0, "isDirectShare"

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    iput-boolean v0, p0, Lcom/instagram/android/activity/k;->e:Z

    .line 198
    :cond_1
    return-void
.end method
